package cn.wj.school.cloud.service;

import cn.wj.school.cloud.dto.PageResponse;
import cn.wj.school.cloud.dto.PrivilegeCheckDTO;
import cn.wj.school.cloud.dto.SyResourceDTO;
import cn.wj.school.cloud.dto.SyUserDTO;
import cn.wj.school.cloud.dto.condition.ResourceCondition;

/**
 * @Author: yueding
 * @Description:
 * @Date: Created in 15:48 2019/1/9
 * @Modified By: yueding
 * Copyright(c) cai-inc.com
 */
public interface ResourceService {
    /**
     * 是否有权限访问相关url
     * @param user
     * @param requestURI
     * @return
     */
    PrivilegeCheckDTO isResourcePermit(SyUserDTO user, String requestURI);

    /**
     * 分页查询资源信息
     * @param condition
     * @return
     */
    PageResponse<SyResourceDTO> getResourcesByCondition(ResourceCondition condition);


    /**
     * 获取资源详情
     * @param resourceId
     * @return
     */
    SyResourceDTO getResoureDetailById(Long resourceId);


    /**
     * 保存resource
     * @param dto
     */
    void saveResource(SyResourceDTO dto);


    /**
     * 修改
     * @param dto
     */
    void modifyResource(SyResourceDTO dto);


    /**
     * 删除
     * @param resourceId
     */
    void removeResource(Long resourceId);
}
